import {Authority} from '../request'

const {get, post} = Authority

// 获取入库对应的 销售合同、 采购合同、生产计划选择列表
export const getInOrderSelectList = params => get('/erp/in-order/v1/querySelectOrderList', {params})

// 新增入库单
export const addInOrder = params => post('/erp/in-order/v1/add', params)
// 修改入库单
export const updateInOrder = params => post('/erp/in-order/v1/update', params)
// 确认入库单
export const confirmInOrder = params => post('/erp/in-order/v1/updateStatus', params)
//获取入库单列表
export const getInOrderList= params => get('/erp/in-order/v1/queryList', {params})

// 新增出库单
export const addOutOrder = params => post('/erp/out-order/v1/add', params)
// 修改出库单
export const updateOutOrder = params => post('/erp/out-order/v1/update', params)
// 确认出库单
export const confirmOutOrder = params => post('/erp/out-order/v1/updateStatus', params)
//获取出库单列表
export const getOutOrderList= params => get('/erp/out-order/v1/queryList', {params})
// 获取出库对应的 销售合同、 采购合同、生产计划选择列表
export const getOutOrderSelectList = params => get('/erp/out-order/v1/querySelectOrderList', {params})

////////////////////////采购相关
// 新增采购单
export const addPurchaseOrder = params => post('/erp/purchase-order/v1/add', params)
// 获取采购订单列表
export const getPurchaseOrderList = params => get('/erp/purchase-order/v1/queryList', {params})
// 更新采购单
export const updatePurchaseOrder = params => post('/erp/purchase-order/v1/update', params)

///////////////////////销售相关
// 新增销售单
export const addSaleOrder = params => post('/erp/sale-order/v1/add', params)
// 获取销售订单列表
export const getSaleOrderList = params => get('/erp/sale-order/v1/queryList', {params})
// 更新采销售单
export const updateSaleOrder = params => post('/erp/sale-order/v1/update', params)
// 销售订单状态修改
export const updateSaleOrderStatus = params => post('/erp/sale-order/v1/updateOrderStatus', params)

///////////////////////财务相关
// 新增账单
export const addFinanceOrder = params => post('/erp/finance-order/v1/add', params)
// 获取账单记录列表
export const getFinanceOrderList = params => get('/erp/finance-order/v1/queryList', {params})
// 获取销售订单或采购订单选择列表
export const getOrderSelectList = params => get('/erp/finance-order/v1/querySelectOrderList', {params})
// 货品统计柱状图
export const erpGoods = params => get('/statistics/erp/v1/goods', {params})

 // 统计所有客户销售订单数量柱状图
export const erpSaleOrder = params => get('/statistics/erp/v1/saleOrder', {params})
// 客户订单中各货品的数量占比
export const erpSaleGoodsByCompany = params => get('/statistics/erp/v1/saleGoodsByCompany', {params})
